<?php
$arr = array_keys($data->currencies); //in order for next to work

?>
<!-- WEB CONTENT -->
<div id="container_content">
<div id="admin_page">
<div id="admin_currency_page">
    <p>Currency Management | Main Currency : ₦ (Naira) | Below rates are for 1 Naira</p><br/>
    <form method="GET" action="">
        <input type="hidden" name="p" value="admin" />
        <div class="currency_holder">
            <div class="currency">
                <label for="curr2">Currency 2:</label>
                <input type="text" class="holder_curr_name" name="curr2" id="curr2" value="<?php echo next($arr);?>" />
                <label for="curr2_value"></label>
                <input type="text" name="curr2_value" id="curr2_value" value="<?php echo $data->currencies[current($arr)];?>" />
            </div>
            <div class="currency">
                <label for="curr3">Currency 3:</label>
                <input type="text" class="holder_curr_name" name="curr3" id="curr3" value="<?php echo next($arr);?>" />
                <label for="curr3_value"></label>
                <input type="text" name="curr3_value" id="curr3_value" value="<?php echo $data->currencies[current($arr)];?>" />
            </div>
        </div>
        <div class="currency_holder">
            <div class="currency">
                <label for="curr4">Currency 4:</label>
                <input type="text" class="holder_curr_name" name="curr4" id="curr4" value="<?php echo next($arr);?>" />
                <label for="curr4_value"></label>
                <input type="text" name="curr4_value" id="curr4_value" value="<?php echo $data->currencies[current($arr)];?>" />
            </div>
            <div class="currency">
                <label for="curr5">Currency 5:</label>
                <input type="text" class="holder_curr_name" name="curr5" id="curr5" value="<?php echo next($arr);?>" />
                <label for="curr5_value"></label>
                <input type="text" name="curr5_value" id="curr5_value" value="<?php echo $data->currencies[current($arr)];?>" />
            </div>
            <div class="currency">
                <label for="curr6">Currency 6:</label>
                <input type="text" class="holder_curr_name" name="curr6" id="curr6" value="<?php echo next($arr);?>" />
                <label for="curr6_value"></label>
                <input type="text" name="curr6_value" id="curr6_value" value="<?php echo $data->currencies[current($arr)];?>" />
            </div>
        </div>
        <div id="submit_currency">
            <input type="image" src="img/make_currency_changes.png">
        </div>
    </form>
</div>
<br/>
<br/>
<div class="add_auto_service_center">Click to add a new Auto Service Center</div>
<div class="add_auto_service_center_content">
    <form action="" method="POST" enctype="multipart/form-data">
        <div class="register_user_inputs_holder">
            <ul>
                <li>
                    <h2>Business Type</h2>
                    <div class="styling_select">
                        <label for="business_type"></label>
                        <select name="business_type" id="business_type">
                            <option value="">-- select --</option>
                            <option value="Car Grooming Center">Car Grooming Center</option>
                            <option value="Cars Customization">Cars Customization</option>
                            <option value="Auto Service Center">Auto Service Centers</option>
                        </select>
                    </div>
                </li>
                <li>
                    <h2>Company Name</h2>
                    <label for="company_name"></label><input type="text" name="company_name" id="company_name" />
                </li>
                <li>
                    <h2>Contact Person</h2>
                    <label for="contact_person"></label><input type="text" name="contact_person" id="contact_person" />
                </li>
            </ul>
        </div>
        <div class="register_user_inputs_holder">
            <ul>
                <li>
                    <h2>State</h2>
                    <div class="styling_select">
                        <label for="state"></label>
                        <select name="state" id="state">
                            <option value="">-- select --</option>
                            <?php
                            foreach ($data->lists['states'] as $v) {
                                echo "<option value='".$v."'>${v}</option>";
                            }
                            ?>
                        </select>
                    </div>
                </li>
                <li>
                    <h2>Postal Code</h2>
                    <label for="email"></label><input type="text" name="postal_code" id="postal_code" />
                </li>
                <li>
                    <h2>City</h2>
                    <label for="city"></label><input type="text" name="city" id="city" />
                </li>
            </ul>
        </div>
        <div class="register_user_inputs_holder">
            <ul>
                <li>
                    <h2>Phone</h2>
                    <label for="phone"></label><input type="text" name="phone" id="phone" />
                </li>
                <li>
                    <h2>Email</h2>
                    <label for="email"></label><input type="text" name="email" id="email" />
                </li>
                <li>
                    <h2>Upload Company Logo</h2>
                    <div id="style_dealer_image_upload">
                        <input type="file" name="company_logo" id="company_logo" />
                    </div>
                </li>
            </ul>
        </div>
        <input type="image" src="img/register_button.png" value="Register!" name="submit" class="add_auto_service_center_button"/>
    </form>
</div>
<br/>
<br/>
<br/>

<table>
<tr>
    <th>Stock ID</th>
    <th>Type</th>
    <th>View Ad</th>
    <th>Date Added</th>
    <th>User</th>
    <th>Delete</th>
    <th>Approve</th>
</tr>

    <?php
    foreach ($data->adv_list as $k => $v) {
        echo '
<tr class="'.($k%2 ? 'not_colored' : 'colored').'">
    <td>'.$v['adv_id'].'</td>
    <td>'.($v['is_part'] ? 'Part' : 'Auto').'</td>
    <td>
        <div class="table_images_admin">
            <a href="'.
            ($v['is_part'] ? '?p=adv_view&type=part&adv_id='.$v['adv_id'] : '?p=adv_view&type=car&adv_id='.$v['adv_id'])
            .'" target="_blank"><img src="img/view.png" alt=""></a>
        </div>
    </td>
    <td>'.$v['date_added'].'</td>
    <td>'.$v['username'].'</td>
    <td>
        <div class="table_images_admin adv_ajaxdelete">
            <img src="img/delete.png" data-user="'.$v['seller_id'].'" data-id="'.$v['adv_id'].'" data-type="'.($v['is_part'] ? 'parts' : 'car').'" alt="">
        </div>
    </td>
    <td>
        <div class="table_images_admin adv_ajaxapprove">
            <img src="'.($v['is_active'] ? 'img/approve_green.png' : 'img/approve.png').'" data-id="'.$v['adv_id'].'" data-type="'.($v['is_part'] ? 'part' : 'car').'" alt="">
        </div>
    </td>
</tr>';
    }

    ?>
</table>
</div>
</div>